home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / DEFS.H < prev    next >
C/C++ Source or Header  |  1991-06-20  |  3KB  |  99 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * Common definitions for all of InterViews.
  25.  */
  26.  
  27. #ifndef iv_defs_h
  28. #define iv_defs_h
  29.  
  30. /*
  31.  * A boolean type can't be an enum because C++ enums should not be
  32.  * promoted to ints.  So, boolean f() { return !g(); } is an error
  33.  * if boolean is an enum.
  34.  */
  35.  
  36. typedef unsigned boolean;
  37.  
  38. static const boolean false = 0;
  39. static const boolean true = 1;
  40.  
  41. /*
  42.  * Alignment needs to be unsigned so that it can be stored
  43.  * as a bit field.
  44.  */
  45.  
  46. typedef unsigned Alignment;
  47.  
  48. static const Alignment TopLeft = 0;
  49. static const Alignment TopCenter = 1;
  50. static const Alignment TopRight = 2;
  51. static const Alignment CenterLeft = 3;
  52. static const Alignment Center = 4;
  53. static const Alignment CenterRight = 5;
  54. static const Alignment BottomLeft = 6;
  55. static const Alignment BottomCenter = 7;
  56. static const Alignment BottomRight = 8;
  57. static const Alignment Left = 9;
  58. static const Alignment Right = 10;
  59. static const Alignment Top = 11;
  60. static const Alignment Bottom = 12;
  61. static const Alignment HorizCenter = 13;
  62. static const Alignment VertCenter = 14;
  63.  
  64. enum TextStyle {
  65.     Plain = 0x0,
  66.     Boldface = 0x1,
  67.     Underlined = 0x2,
  68.     Reversed = 0x4,
  69.     Outlined = 0x8
  70. };
  71.  
  72. typedef int Coord;
  73.  
  74. extern double inch, inches, cm, point, points;
  75. static const int pixels = 1;
  76.  
  77. #ifndef nil
  78. #define nil 0
  79. #endif
  80.  
  81. #if !defined(__cplusplus)
  82. overload min;
  83. overload max;
  84. #endif
  85.  
  86. int min (int a, int b);
  87. float min (float a, float b);
  88. double min (double a, double b);
  89.  
  90. int max (int a, int b);
  91. float max (float a, float b);
  92. double max (double a, double b);
  93.  
  94. int round (double x);
  95.  
  96. #endif
  97.  
  98.  
  99.